﻿using Castle.Core.Logging;
using Castle.MicroKernel.Facilities;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using NUnit.Framework;

namespace WindsorInitConfig {
    [TestFixture]
    public class AllTypesFacilityTests {
        [Test]
        public void ttt() {
            var container = new WindsorContainer(@"..\..\AllTypesConfig.xml");
            container.AddFacility("alltypes", new AllTypesFacility());
            container.Resolve<NullLogger>();
        }

        public class AllTypesFacility : AbstractFacility {
            protected override void Init() {
                var asmList = FacilityConfig.Children["assemblies"].Children;
                foreach (var asm in asmList)
                    Kernel.Register(AllTypes.Pick().FromAssemblyNamed(asm.Value));
            }
        }
    }
}